package com.tech.zhidengxian.model.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

@Data
public class CosDTO implements Serializable {
    private Long id;
    private String fileBizType;
    private String name;
    private String path;
    private String uploadName;
    private String url;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CosDTO)) {
            return false;
        }
        CosDTO cosDTO = (CosDTO) o;
        if ((cosDTO.id == null||cosDTO.id<= 0) && (cosDTO.name == null||cosDTO.name.isEmpty())) {
            return false;
        }
        return Objects.equals(id, cosDTO.id) && Objects.equals(name,cosDTO.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name);
    }
}
